package com.dailyblue.java.io;

import java.io.*;

// 转换流：字节流--->字符流
public class DemoJ {
    private static void a() throws IOException{
        InputStream in = new FileInputStream("/Users/dailyblue/soft/smbms_db.sql");
        // 将这个字节流变成字符流
        Reader reader = new InputStreamReader(in);
        char[] buf = new char[10];
        int len = reader.read(buf);
        String str = new String(buf,0,len);
        System.out.println(str);
        reader.close();
    }
    private static void b() throws IOException{
        OutputStream out = new FileOutputStream("/Users/dailyblue/soft/1.txt");
        Writer writer = new OutputStreamWriter(out);
        writer.write("今天是星期六！");
        writer.flush();
        writer.close();
    }
    public static void main(String[] args) throws IOException {
        b();
    }
}
